import backend.*;
import java.sql.SQLException;
import java.util.Timer;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Main {
	private final static int s30 = 30 * 1000; // 30 seconds
	private final static int m15 = 15 * 60 * 1000;
	
	public static void main( String argv[] ) {
		try {
			// create a new TimerTask to timeout inactive users
			TimeoutUsers tu = new TimeoutUsers(300); // 300 seconds
			Scores scores = new Scores();
			// schedual the timer task
			Timer timer = new Timer();
			timer.scheduleAtFixedRate(tu,     0, s30);
			timer.scheduleAtFixedRate(scores, 0, m15);
			
		} catch (SQLException ex) {
			Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
		}
	}
}
